<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('candidate')} > ${i18n.getMessage('register')}">
	<a href="#" onclick="cc('englishtest/showInfoCandidate.sgt?id=${candidate.id}');">${i18n.getMessage('candidate')} ${i18n.getMessage('info')}</a>
</@showTitle>

<div id="error" style="display:none"></div>

<form action="register/editRegister.sgt" validator="register/validateRegister.sgt" onsubmit="submitFormValidation(this); return false;" onreset="$('error').hide()">
	<input type="hidden" name="id" value="${(register.id)}" />
	<input type="hidden" name="candidateId" value="${(candidate.id)}" />
	<table id="dataTable" align="center" cellspacing="5" cellpadding="0"><tr>
		<td class="name">${i18n.getMessage('candidate.code')}:</td>
		<td>${(candidate.candidateCode)!}</td>
	</tr><tr>
		<td class="name">${i18n.getMessage('fullName')}:</td>
		<td>${(candidate.fullName)!}</td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('receipt.number')}:</td>
		<td><input type="text" name="number" value="${(register.receiptNumber)!}" class="w200" /></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('fee')}:</td>
		<td><input type="text" name="fee" value="${(register.fee.amount)!}" class="right w080" /> ${i18n.getMessage('currency.vnd')}</td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('bank.account')}:</td>
		<td><select name="bankAccountId" class="w200">
			<#list bankAccounts as bankAccount>
				<option value="${(bankAccount.id)!}" <#if (register.bankAccount.id == bankAccount.id)>selected="selected"</#if>>${(bankAccount.number)!}</option>
			</#list>
		</select></td>
	</tr><tr>
		<td class="name"><@required/>Registered Date:</td>
		<td><input type="text" name="registeredDate" value="${(register.date)!}" class="w200"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].consultedDate, '${i18n.getMessage('format.date')}', this)"/></td>
	</tr><tr>
		<td class="name"><@required/>${i18n.getMessage('Cashier')}:</td>
		<td><select name="consultantId" class="w200">
			<option></option>
			<#list consultants as consultant>
				<option value="${(consultant.id)!}" <#if (register.cashier.id == consultant.id)>selected="selected"</#if>>${(consultant.fullName)!}</option>
			</#list>
		</select></td>
	</tr><tr>
		<td class="name" style="vertical-align:top">${i18n.getMessage('comment')}:</td>
		<td><textarea name="comment" class="w350 h075">${(register.comment)!}</textarea></td>
	</tr><tr>
		<td class="name"></td>
		<td>
			<input type="submit" value="${i18n.getMessage('update')}" class="button_style"/> 
			<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
		</td>
	</tr></table>
</form>

<script>
$('error').hide();
showHideInfo = function(selector) {
	if (selector.value == "") {
		$("pop").style.display = "none"
	}
	else { $("pop").style.display = "" }
}
</script>